#include <iostream>
#include <numeric>
#include <functional>
#include "l1calcapi.h"

double l1api::calcMean(const struct l1api::l1DataType &data){
  if(data.listData.empty())
    return -1;
  int sum=0;
  sum = std::accumulate(data.listData.begin(),data.listData.end(), 0);
  return static_cast<double>(sum)/static_cast<double>(data.listData.size());
}
